<template>
    <div >
        <div v-if="jj.length !== 0">
            <div class="jj-onetype" v-for="(item,index) in jj" :key="index" >
                <span>{{item.title}}</span>
                <div class="jj-content" v-html="$options.filters.br2p(item.content)"></div>
            </div>
        </div>
        <div v-else class="none">无对应检索结果</div>
    </div>


</template>

<script>
    import {getJinjiTextByType} from "../../../network/jinji";

    export default {
        name: "jinjicontent",
        props:{
            jj:{},

        },
        mounted() {
            console.log(this.jj);
        },

        filters:{
            br2p(value){
                return  "&emsp;&emsp;" + value.replace(new RegExp("<br>","g"),"<br>&emsp;&emsp;")
            },
            gettypename(value){
                getJinjiTextByType(value).then(res=>{
                    console.log(res.data);
                    const stype = res.data.name
                    return stype
                })

            }
        }

    }
</script>

<style scoped>
    .jj-content {
        background-color: white;
        border-radius: 25px;

        margin: 10px;
        padding:5px;
        font-family: "FangSong";
        line-height: 1.5;



    }


    .jj-content >>>strong
    {
        color:greenyellow;
        background-color: #333333;
    }


    .jj-onetype span{

        margin: 20px;
        font-family: FangSong;
        font-weight: bold;
        line-height: 2;
    }

    .none{
        font-family: FangSong;
    }
</style>